/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clientereligadora.formularios;

import clientereligadora.entidades.Status_Religadora;
import clientereligadora.operacoes.Operacao;
import clientereligadora.tableModel.ReligadoraTableModel;
import java.awt.Cursor;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.SwingConstants;
import javax.swing.Timer;

import javax.swing.table.DefaultTableCellRenderer;
import org.jfree.data.category.DefaultCategoryDataset;

/**
 *
 * @author leandro.aquino
 */
public final class FormVisualizaReligadoras extends javax.swing.JFrame {
SimpleDateFormat dateFormatDB = new SimpleDateFormat("yyyy-MM-dd");
    List<Status_Religadora> listaReligadoras;
    ReligadoraTableModel religadoraTableModel;
    private Timer timer;
    Operacao operacao = new Operacao();
    String filtro = "";
    FormLineChart ln;
    int estadoChave;
    int estadoMaquina;
    int falhaTensao;
    int falhaCorrente;
    int falhaSobrecarga;
    int avisoSobrecarga;
    int contFalhaTen;
    int contCurtos;
    int contSobrecarga;
    int contAvisSobrecarga;
    int corrCurAtualFA;
    int corrCurAtualFB;
    int corrCurAtualFC;
    int valSobrecargaFA;
    int valSobrecargaFB;
    int valSobrecargaFC;
    int limSobrecarga;
    int temSobrecarga;
    int tenFA;
    int tenFB;
    int tenFC;
    int corrFA;
    int corrFB;
    int corrFC;
    int corrFN;
    int estSwitchServico;
    int estOperacao;
    Date data;

    /**
     * Creates new form FormVisualizaReligadoras
     */
    public FormVisualizaReligadoras() throws SQLException {

        listaReligadoras = operacao.getListaReligadoras(filtro);
        religadoraTableModel = new ReligadoraTableModel(listaReligadoras);
        initComponents();
       
        setLocationRelativeTo(this);

        setParTableMedidores();

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbl_statusReligadora = new javax.swing.JTable(religadoraTableModel);
        data1 = new com.toedter.calendar.JDateChooser();
        data2 = new com.toedter.calendar.JDateChooser();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("HISTÓRICO");

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        tbl_statusReligadora.setAutoCreateColumnsFromModel(false);
        tbl_statusReligadora.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        tbl_statusReligadora.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
        tbl_statusReligadora.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tbl_statusReligadora);

        jLabel1.setForeground(new java.awt.Color(0, 153, 153));
        jLabel1.setText("Data Inicio:");

        jLabel2.setForeground(new java.awt.Color(0, 153, 153));
        jLabel2.setText("Data Fim:");

        jButton4.setForeground(new java.awt.Color(0, 153, 153));
        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/LineChart.png"))); // NOI18N
        jButton4.setText("Gerar Gráfico");
        jButton4.setToolTipText("Propriedades da Religadora");
        jButton4.setBorder(null);
        jButton4.setBorderPainted(false);
        jButton4.setContentAreaFilled(false);
        jButton4.setFocusPainted(false);
        jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton4MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton4MouseExited(evt);
            }
        });
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton1.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N
        jButton1.setForeground(new java.awt.Color(0, 0, 102));
        jButton1.setText("Listar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 994, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(data1, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(42, 42, 42)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(data2, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButton1)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(data1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(data2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton4))
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(3, 3, 3))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton4MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));
    }//GEN-LAST:event_jButton4MouseEntered

    private void jButton4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseExited
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }//GEN-LAST:event_jButton4MouseExited

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        int cod;
        
        DefaultCategoryDataset ds = new DefaultCategoryDataset();
        
        try {
            cod = Integer.parseInt(tbl_statusReligadora.getValueAt(tbl_statusReligadora.getSelectedRow(), 0).toString());
        } catch (ArrayIndexOutOfBoundsException e) {
            JOptionPane.showMessageDialog(null, "ATENÇÃO!\n NENHUM ITEM SELECIONADO \n"+e);
            return;
        }

        if (cod < 0) {
        } else {

            int[] linhas = tbl_statusReligadora.getSelectedRows();

            for (int i = 0; i < linhas.length; i++) {

                estadoChave = listaReligadoras.get(linhas[i]).getEstado_chave();
                estadoMaquina = listaReligadoras.get(linhas[i]).getEstado_maquina();
                falhaTensao = listaReligadoras.get(linhas[i]).getFalha_tensao();
                falhaCorrente = listaReligadoras.get(linhas[i]).getFalha_corrente();
                falhaSobrecarga = listaReligadoras.get(linhas[i]).getFalha_sobrecarga();
                avisoSobrecarga = listaReligadoras.get(linhas[i]).getAviso_sobrecarga();
                contFalhaTen = listaReligadoras.get(linhas[i]).getContador_falhas_tensao();
                contCurtos = listaReligadoras.get(linhas[i]).getContador_curtos();
                contSobrecarga = listaReligadoras.get(linhas[i]).getContador_sobrecarga();
                contAvisSobrecarga = listaReligadoras.get(linhas[i]).getContador_aviso_sobrecarga();
                corrCurAtualFA = listaReligadoras.get(linhas[i]).getCorrente_curto_atual_fase_a();
                corrCurAtualFB = listaReligadoras.get(linhas[i]).getCorrente_curto_atual_fase_b();
                corrCurAtualFC = listaReligadoras.get(linhas[i]).getCorrente_curto_atual_fase_c();
                valSobrecargaFA = listaReligadoras.get(linhas[i]).getValor_sobrecarga_fase_a();
                valSobrecargaFB = listaReligadoras.get(linhas[i]).getValor_sobrecarga_fase_b();
                valSobrecargaFC = listaReligadoras.get(linhas[i]).getValor_sobrecarga_fase_c();
                limSobrecarga = listaReligadoras.get(linhas[i]).getLimite_sobrecarga();
                temSobrecarga = listaReligadoras.get(linhas[i]).getTempo_sobrecarga();
                tenFA = listaReligadoras.get(linhas[i]).getTensao_fase_a();
                tenFB = listaReligadoras.get(linhas[i]).getTensao_fase_b();
                tenFC = listaReligadoras.get(linhas[i]).getTensao_fase_c();
                corrFA = listaReligadoras.get(linhas[i]).getCorrente_fase_a();
                corrFB = listaReligadoras.get(linhas[i]).getCorrente_fase_b();
                corrFC = listaReligadoras.get(linhas[i]).getCorrente_fase_c();
                corrFN = listaReligadoras.get(linhas[i]).getCorrent_fase_neutro();
                estSwitchServico = listaReligadoras.get(linhas[i]).getEstado_switch_servico();
                estOperacao = listaReligadoras.get(linhas[i]).getEstado_operacao();
                data = listaReligadoras.get(linhas[i]).getDatetime();

              
                ds.addValue(estadoMaquina, "" + i, "Est Maq");
                ds.addValue(estadoMaquina, "" + i, "Est Maq");
                ds.addValue(falhaTensao, "" + i, "F.Ten");
                ds.addValue(falhaCorrente, "" + i, "F.Corr");
                ds.addValue(falhaSobrecarga, "" + i, "F Sbcgr");
                ds.addValue(avisoSobrecarga, "" + i, "Av Sbcgr");
                ds.addValue(contFalhaTen, "" + i, "Con f Ten");
                ds.addValue(contCurtos, "" + i, "Con Cur");
                ds.addValue(contSobrecarga, "" + i, "Con Sbcgr");
                ds.addValue(contAvisSobrecarga, "" + i, "Con AvSbcgr");
                ds.addValue(corrCurAtualFA, "" + i, "C C FA");
                ds.addValue(corrCurAtualFB, "" + i, "C C FB");
                ds.addValue(corrCurAtualFC, "" + i, "C C FC");
                ds.addValue(valSobrecargaFA, "" + i, "ValSbcgrFA");
                ds.addValue(valSobrecargaFB, "" + i, "ValSbcgrFB");
                ds.addValue(valSobrecargaFC, "" + i, "ValSbcgrFC");
                ds.addValue(limSobrecarga, "" + i, "LimSbcgr");
                ds.addValue(temSobrecarga, "" + i, "T Sbcgr");
                ds.addValue(tenFA, "" + i, "tenFA");
                ds.addValue(tenFB, "" + i, "tenFB");
                ds.addValue(tenFC, "" + i, "tenFC");
                ds.addValue(corrFA, "" + i, "corrFA");
                ds.addValue(corrFB, "" + i, "corrFB");
                ds.addValue(corrFC, "" + i, "corrFC");
                ds.addValue(corrFN, "" + i, "corrFN");
                ds.addValue(estSwitchServico, "" + i, "EstSwSer");
                ds.addValue(estOperacao, "" + i, "Est Op");

                try {
           
                    ln = new FormLineChart(ds);
                    
                } catch (SQLException ex) {
                    Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(Level.SEVERE, null, ex);
                }

            }
            ln.setVisible(true);
        }
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
      
        
        String d1 = dateFormatDB.format(data1.getDate());
       String d2 = dateFormatDB.format(data2.getDate());
        System.out.println("data"+ d1);
       buscaData(d1, d2);
       
    }//GEN-LAST:event_jButton1ActionPerformed
 private void buscaData(String dt1,String dt2) {

      filtro = "  WHERE dataserverreligadora.status_religadora.`data` >='"+dt1+"'   AND "
             + "dataserverreligadora.status_religadora.`data` <='"+dt2+"'  ";

     listaReligadoras = operacao.getListaReligadoras(filtro);
     religadoraTableModel = new ReligadoraTableModel(listaReligadoras);

     tbl_statusReligadora.setModel(religadoraTableModel);
     setParTableMedidores();

    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new FormVisualizaReligadoras().setVisible(true);
                } catch (SQLException ex) {
                    Logger.getLogger(FormVisualizaReligadoras.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.toedter.calendar.JDateChooser data1;
    private com.toedter.calendar.JDateChooser data2;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable tbl_statusReligadora;
    // End of variables declaration//GEN-END:variables
    public void setParTableMedidores() {
        //centraliza titulo da coluna no JTable
        ((DefaultTableCellRenderer) tbl_statusReligadora.getTableHeader().getDefaultRenderer()).setHorizontalAlignment(SwingConstants.CENTER);

        //Centraliza dados da coluna 
        DefaultTableCellRenderer centralizado = new DefaultTableCellRenderer();
        centralizado.setHorizontalAlignment(SwingConstants.CENTER);


        tbl_statusReligadora.getColumnModel().getColumn(0).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(0).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(0).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(1).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(1).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(1).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(2).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(2).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(2).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(3).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(3).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(3).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(4).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(4).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(4).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(5).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(5).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(5).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(6).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(6).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(6).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(7).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(7).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(7).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(8).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(8).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(8).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(9).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(9).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(9).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(10).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(10).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(10).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(11).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(11).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(11).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(12).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(12).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(12).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(13).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(13).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(13).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(14).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(14).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(14).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(15).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(15).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(15).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(16).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(16).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(16).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(17).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(17).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(17).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(18).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(18).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(18).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(19).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(19).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(19).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(20).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(20).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(20).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(21).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(21).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(21).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(22).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(22).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(22).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(23).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(23).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(23).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(24).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(24).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(24).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(25).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(25).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(25).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(26).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(26).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(26).setMaxWidth(100);

        tbl_statusReligadora.getColumnModel().getColumn(27).setCellRenderer(centralizado);
        tbl_statusReligadora.getColumnModel().getColumn(27).setMinWidth(80);
        tbl_statusReligadora.getColumnModel().getColumn(27).setMaxWidth(100);

    }
}
